package com.zz.bid.mapper;

import com.zz.bid.pojo.entity.Group;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GroupMapper {
    @Select("select id,name,operation from op_group where id=#{groupId}")
    Group getGroup(@Param("groupId") Integer groupId);

    @Select("select id,name,operation from op_group")
    List<Group> getGroups();

    @Update("update op_group set operation=#{operation} where id=#{groupId}")
    void setGroupAccess(@Param("groupId") Integer groupId, @Param("operation") String operation);

    @Insert("insert into op_group(name) values(#{groupName})")
    void addGroup(@Param("groupName") String groupName);
}
